package d1_com.itheima.properties;

import java.io.FileReader;
import java.util.Properties;
import java.util.Set;

/**
 *
 */
public class Test {
    public static void main(String[] args) throws Exception {
        //1、创建一个Properties的对象出来(键值对集合，空容器)
        Properties properties = new Properties();
        // 2、开始加载属性文件中的键值对数据到properties对象中去
        properties.load(new FileReader("oop-app9\\src\\d1_com\\itheima\\properties\\user.properties"));
        System.out.println(properties);

        System.out.println(properties.getProperty("赵敏"));
        System.out.println(properties.getProperty("张无忌"));

        Set<String> keys = properties.stringPropertyNames();
        for (String key : keys) {
            System.out.println(key + "--->" + properties.getProperty(key));
        }


    }
}
